#include <QtGui>
#include <QAction>
#include <QItemSelectionModel>

#include "..\core\src\AssetManager.h"
#include "AssetModel.h"
#include "AssetPool.h"
#include "TreeView.h"
#include "ResultView.h"
#include "AssetSelector.h"

class QMenuBar;
class QMainWindow;
class QDockWidget;
class QToolbar;
class ResultView;

typedef QList<XpsAssets::TreeNode*> TreeNodeList;

namespace Xps
{

	class MainWindow : public QMainWindow
	{
		Q_OBJECT

	private:
		XpsAssets::AssetManager* am;

		/// Main Toolbar
		QToolBar* tb1;

		/// Graph Toolbar
		QToolBar* tb2;

		/// Asset Pool Toolbar
		QToolBar* tb3;

		/// workspace tab widget
		QTabWidget* tab;

		/// result workspace (part of workspace tab)
		Xps::ResultView* results;

		/// graph workspace (part of workspace tab)
		Xps::TreeView* treeview;

		/// dockwidget asset pool default position right
		Xps::AssetPool* assetpool;

		/// list of all dockwidgets (currently just one)
		QMap<QString, QDockWidget*> dockwidgets;
		
		/// action list start stores all major actions for tb1
		QList<QAction*> actions;

		void setupActions();
		void addDockWidget(QString name, QWidget* widget);
		void save(QString filename);
		TreeNodeList constructTree();
	
	public:
		MainWindow();
		
	public slots:
		void addQuestionItem();
		void newProject();
		void saveProject();
		void saveAsProject();
		void openProject();
		void runProject();
		void cleanUp();
		void switchWorkspace(int ws);
		void addConstraintAttribute();
	};

}